{% load utils_tags statistics_tags %}
<div class="NB-module NB-module-stats NB-module-site-stats">
  <!-- <h5 class="NB-module-header">
    Site Statistics
  </h5> -->
  
  <div class="NB-splash-module-section">
      <h3 class="NB-module-content-header">
        Past day
      </h3>
  
      <div class="NB-module-stats-counts">
          <div class="NB-module-stats-count">
            <div class="NB-module-stats-count-number">{{ statistics.premium_users|commify }}</div>
            <div class="NB-module-stats-count-description">Premium Users</div>
          </div>
          <div class="NB-module-stats-count">
            <div class="NB-module-stats-count-number">{{ statistics.standard_users|commify }}</div>
            <div class="NB-module-stats-count-description">Standard Users</div>
          </div>
          <div class="NB-module-stats-count">
            <div class="NB-module-stats-count-number">{{ statistics.feeds_fetched|commify }}</div>
            <div class="NB-module-stats-count-description">Feeds fetched</div>
          </div>
      </div>
  </div>
  
  <div class="NB-splash-module-section">
      <h3 class="NB-module-content-header NB-module-content-header-hour">
        Past day by hour
      </h3>
  
      <div class="NB-module-stats-counts">
          <div class="NB-module-stats-count">
            <div class="NB-module-stats-count-graph">
              {% for i in statistics.sites_loaded %}<div class="NB-graph-value">
                <div class="NB-graph-label">{{ i|commify }}</div>
                <div class="NB-graph-bar" style="height:{{ i|format_graph:statistics.max_sites_loaded }}px"></div>
              </div>{% endfor %}
            </div>
            <div class="NB-module-stats-count-number">{{ statistics.total_sites_loaded|commify }}</div>
            <div class="NB-module-stats-count-description">Sites loaded</div>
          </div>
          <div class="NB-module-stats-count">
            <div class="NB-module-stats-count-graph">
              {% for i in statistics.avg_time_taken %}
              <div class="NB-graph-value">
                <div class="NB-graph-label">{{ i|floatformat:2 }}</div>
                <div class="NB-graph-bar" style="height:{{ i|format_graph:statistics.max_avg_time_taken }}px"></div>
              </div>
              {% endfor %}
            </div>
            <div class="NB-module-stats-count-number">{{ statistics.last_1_min_time_taken|floatformat:2 }} <small>sec</small></div>
            <div class="NB-module-stats-count-description">Avg. load time</div>
          </div>
          <div class="NB-module-stats-count">
            <div class="NB-module-stats-count-graph">
              {% for i in statistics.stories_shared %}
              <div class="NB-graph-value">
                <div class="NB-graph-label">{{ i|commify }}</div>
                <div class="NB-graph-bar" style="height:{{ i|format_graph:statistics.max_stories_shared }}px"></div>
              </div>
              {% endfor %}
            </div>
            <div class="NB-module-stats-count-number">{{ statistics.total_stories_shared|commify }}</div>
            <div class="NB-module-stats-count-description">
                {% if statistics.latest_stories_shared == 1 %}Story{% else %}Stories{% endif %} Shared
            </div>
          </div>
      </div>
  </div>
  
</div>
